<template>
  <div>
    <h3>
      <a href="#/Student">学生管理</a> &nbsp;&nbsp;&nbsp;
      <a href="#/Classroom">班级管理</a>
    </h3>
    <hr>
    <component :is="link"></component>
  </div>
</template>

<script>
import Student from '@/components/Student.vue'
import Classroom from '@/components/Classroom.vue'
export default {
  data () {
    return {
      link: 'Student'
    }
  },
  components: {
    Student, Classroom
  },
  mounted () {
    window.onhashchange = () => {
      console.log(this.link)
      const tt = location.hash
      this.link = tt.slice(2)
    }
  }
}
</script>
